package com.example.day02.Imp;

import com.example.anno.CheckUser;
import com.example.day02.MathDao;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;


@Repository
public class MathDaoImp implements MathDao {

    @CheckUser("admin")
    @Override
    public int add(int i, int j) {
        System.out.println("进入add...........");
//        System.out.println(10/0);
//        if(i==1){
//            throw  new RuntimeException("sorry,not in 1 i ");
//        }
        return i+j;
    }

    @Override
    public int sub(int i, int j) {
        System.out.println("进入sub.....");
        return i-j;
    }
}
